{#人员分析模块#}
<head>
    {#        <meta charset="utf-8">#}
    {#        <meta http-equiv="refresh" content="60">#}
    {#        <meta name="robots" content="index, follows">#}
    {#        <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">#}
    {#        <meta http-equiv="x-ua-compatible" content="ie=edge">#}
    <link href="../static/css/bk.css" rel="stylesheet">
</head>
<script>

    function FileUpload() {
        formData = new FormData();
        {#var name = $("input").val();#}
        var file = $("#file_upload")[0].files[0]
        if (file != null) {
            formData.append("file", file);
            {#formData.append("name", name);#}
            $.ajax({
                url: 'staff_analyst/',
                type: 'POST',
                data: formData,
                // 告诉jQuery不要去处理发送的数据
                processData: false,
                // 告诉jQuery不要去设置Content-Type请求头
                contentType: false,
                beforeSend: function () {
                    layer.msg('上传中');
                },
                success: function (data) {
                    if (data === '0') {
                        layer.msg('上传成功', {time: 1000});
                        clickData('staff_analyst/')
                    } else {
                        layer.msg('文件格式符合要求' + data, {time: 3000});
                    }
                },
                error: function (data) {
                    layer.msg('文件格式符合要求' + data, {time: 3000});
                }
            });
        } else {
            layer.msg('未选择文件', {time: 1000})
        }
        //指定允许上传的文件类型
        upload.render({
            elem: '#test3'
            , url: 'staff_analyst/' //改成您自己的上传接口i
            , accept: 'file' //普通文件
            , done: function (res) {
                layer.msg('上传成功');
                console.log(res);
            }
        });
    }

</script>
{#<form action="/staff_analyst/" method="POST" enctype="multipart/form-data">#}
{#    {% csrf_token %}#}
{#    <p>#}
{#        <input type="file" name="staff_list" placeholder="文件"/>#}
{#    </p>#}
{##}
{##}
{#    <input type="submit" value="提交"/>#}
{#</form>#}

<div class='yb-main' style="width: 680px">
    {#        <h3 style="margin-bottom: 2px; color:yellow">{{ show_time.month }}月份每日平台达成追踪({{ show_time.month }}月{{ show_time.day }}日)</h3>#}
    {#        <h3 style="margin-bottom: 2px; color:yellow">&nbsp;四月份三年期业务日平台({{ show_time.month }}月{{ show_time.day }}日)</h3>#}
    <h2 style="margin-bottom: 2px; color:yellow">&nbsp;人员情况分析</h2>
        <input class="layui-btn layui-btn-primary layui-btn-sm" type="file" name="file" id="file_upload">
{#    <button type="button" class="layui-btn" id="test3"><i class="layui-icon"></i>上传文件</button>#}
        <input class="layui-btn layui-btn-primary layui-btn-sm" type="button" value="上传" onclick="FileUpload()">
    {#        <p style="margin-bottom: 2px;color: yellow">{{ show_time.time }}&nbsp;&nbsp;单位：万元</p>#}
    {#        <p style="margin-bottom: 2px;color: yellow;text-align: right">{{ show_time.time }}本战报仅供业务追踪参考&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>#}
    {% autoescape off %}
        {{ html }}
    {% endautoescape %}
    <p id="day-comment">
        {% autoescape off %}
            {{ comment }}
        {% endautoescape %}
    </p>
</div>

{#{% endblock %}#}
{##}